package com.pn.controller;

import com.pn.entity.Result;
import com.pn.model.AuthInfo;
import com.pn.service.AuthInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/auth")
@RestController
public class AuthInfoController {

    @Autowired
    private AuthInfoService authInfoService;

    @RequestMapping("/auth-tree")
    public Result loadAllAuthTree(){
        //执行业务
        List<AuthInfo> allAuthTree = authInfoService.allAuthTree();
        //响应
        return Result.ok(allAuthTree);
    }


}
